package cn.bluethink.eguan.core.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Id;
import javax.persistence.Table;

import cn.bluethink.eguan.model.core.EgRole;
import cn.bluethink.eguan.model.core.EgUser;

/**
 * 驿馆伙计实体类
 * 
 * @title 苏州中科蓝迪公司所有(c)2016-2021
 * @version 0.1.0
 * @describe 
 * @author liuxn
 * @date  2018年10月13日
 */
@Table(name = "eg_staff")
public class EgStaffEntity implements Serializable{

	private static final long serialVersionUID = 4552189553216977813L;

	@Id
	private Long egid;
	
	@Id
	private Long uid;

	private Integer role1;
	
	private Integer purview1;
	
	private Date ctime;
	
	private Date utime;

	public EgStaffEntity() {
		
	}
	
	public EgStaffEntity(Long egid, Long uid, Integer role1, Integer purview1) {
		this.egid = egid;
		this.uid = uid;
		this.role1 = role1;
		this.purview1 = purview1;
	}
	
	public EgUser createUser() {
		EgUser user = new EgUser(uid, null, null);
		user.setRole(new EgRole(role1, null, purview1));
		return user;
	}
	
	public Long getEgid() {
		return egid;
	}

	public void setEgid(Long egid) {
		this.egid = egid;
	}

	public Long getUid() {
		return uid;
	}

	public void setUid(Long uid) {
		this.uid = uid;
	}

	public Integer getRole1() {
		return role1;
	}

	public void setRole1(Integer role1) {
		this.role1 = role1;
	}

	public Integer getPurview1() {
		return purview1;
	}

	public void setPurview1(Integer purview1) {
		this.purview1 = purview1;
	}

	public Date getCtime() {
		return ctime;
	}

	public void setCtime(Date ctime) {
		this.ctime = ctime;
	}

	public Date getUtime() {
		return utime;
	}

	public void setUtime(Date utime) {
		this.utime = utime;
	}
}
